Ext.onReady(function(){ 

Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'under';

var sm = new Ext.grid.CheckboxSelectionModel();
var cm=new Ext.grid.ColumnModel([ 
sm,
new Ext.grid.RowNumberer({header: "编号",width:40}),
{header:'债项号',dataIndex:'debtNo',hidden:true},
{header:'债项编号',dataIndex:'debtId',width:100},
{header:'债项名称',dataIndex:'debtDesc',width:100},
{header:'客户名称',dataIndex:'custName',width:100},
{header:'合同金额(元)',dataIndex:'debtSum',width:100},
{header:'信贷余额(元)',dataIndex:'debtBalance',width:100},
{header:'债项币种',dataIndex:'currency',width:100},
{header:'债项业务品种',dataIndex:'debtType',width:100},
{header:'分类认定结果',dataIndex:'confirmResult',width:100},
{header:'认定人',dataIndex:'confirmUserId',width:100},
{header:'认定机构',dataIndex:'confirmOrgId',width:100},
{header:'认定日期',dataIndex:'confirmDate',width:100},
{header:'初分结果',dataIndex:'firstResult',width:100},
{header:'初分人',dataIndex:'fruserId',width:100},
{header:'初分机构',dataIndex:'frorgId',width:100}
]); 

var ds=new Ext.data.Store({ 
proxy:new Ext.data.HttpProxy({
url:'obligation/listClassifyRecordConfirmed.do',
method:'POST'
}), 
reader:new Ext.data.JsonReader({ },[
{name:'debtNo', mapping:'debt.debtNo'},
{name:'debtId',mapping:'debt.debtId'}, 
{name:'debtDesc', mapping:'debt.debtDesc'},
{name:'custName', mapping:'debt.custName'},
{name:'debtSum', mapping:'debt.debtSum'},
{name:'debtBalance', mapping:'debt.debtBalance'},
{name:'currency', mapping:'debt.currency'},
{name:'debtType', mapping:'debt.debtType'},
{name:'confirmResult', mapping:'classify.confirmResult'},
{name:'confirmUserId', mapping:'classify.confirmUserId'},
{name:'confirmOrgId', mapping:'classify.confirmOrgId'},
{name:'confirmDate', mapping:'classify.confirmDate'},
{name:'firstResult', mapping:'classify.firstResult'},
{name:'fruserId', mapping:'classify.fruserId'},
{name:'frorgId', mapping:'classify.frorgId'}
]) 
}); 
ds.load({params:{start:0,limit:20}}); 

var grid=new Ext.grid.GridPanel({ 
id:'contentList',
renderTo:"list", 
stripeRows:true,//斑马线效果
title:"资产分类认定-已认定列表", 
height:500, 
cm:cm,
store: ds, 
loadMask: { msg: "加载中..." }, 
viewConfig: {   
                            forceFit:true   
            },   
            bbar: new Ext.PagingToolbar({   
                pageSize: 20,   
                store: ds,   
                displayInfo: true,   
                displayMsg: '第{0} 到 {1} 条数据 共{2}条',   
                emptyMsg: "没有数据"   
            }),
              
});

var form = new Ext.form.FormPanel({ 
	id: 'form', 
	width: 480, 
	height: 300, 
	//样式 
	bodyStyle: 'margin:3px 3px 3px 3px', 
	frame: true,  
	labelWidth: 80, 
	items: 
	[ {
	xtype: 'textfield', 
	 id : "eventType",
	 name: 'eventType',         
	 fieldLabel: '违约事件类型',
	 width: 150
	},{
	xtype: 'textarea',
	id: 'eventDesc', 
	name: 'eventDesc', 
	fieldLabel: '违约事件描述',
	height:100,
	anchor: '97%' 
	}
	]});

var win = new Ext.Window({ 
	id: 'win', 
	title: '查看违约事件详情', 
	width: 500, 
	height: 300, 
	//背景遮罩 
	modal: true, 
	//重置大小 
	resizable: false, 
	//当关闭按钮被点击时执行的动作 
	closeAction: 'hide', 
	plain: true, 
	buttonAlign: 'right', 
	items:form
});

	
//查找客户表单
var form1 = new Ext.form.FormPanel({    
height : 150,
id: 'findForm', 
anchor:'80%', 
bodyStyle: 'margin:3px;text-align:right;padding-left:10px', 
frame: true, 
labelWidth: 80, 
items: 
[ {
           layout : "form",
           items : [{
xtype: 'textfield', 
id: "debtNo",
name: "debtNo",
fieldLabel: '债项编号',
allowBlank : true,
width: 200   
}]},{layout : "form",
           items : [{
xtype: 'textfield', 
id:'debtDesc',
name: 'debtDesc', 
fieldLabel: '债项名称',  
allowBlank: true, 
width:200         
}]},
{layout : "form",
           items : [{
xtype: 'textfield', 
id:'classifyDate',
name: 'classifyDate', 
fieldLabel: '认定日期',  
allowBlank: true, 
width:200         
}]} ,{layout : "form",
           items : [{
xtype: 'textfield', 
id:'firstUser',
name: 'firstUser', 
fieldLabel: '初分人',  
allowBlank: true, 
width:200         
}]} 
],
buttonAlign:'right',
buttons:[{text:"查询"},
{text:"取消", handler: function(){ Ext.getCmp('findForm').form.reset();}}]
});

//客户财报列表窗口 
var win1 = new Ext.Window({ 
id: 'win1', 
title:'<div align="center">查询</div>',
width: 350, 
height: 200, 
//背景遮罩 
modal: true, 
//重置大小 
resizable: false, 
//当关闭按钮被点击时执行的动作 
closeAction: 'hide', 
plain: true, 
items:[form1]
});

function search(){
	 Ext.getCmp("win").show(); 
}

}); 